import { createRouter, createWebHashHistory } from 'vue-router'
import IndexView from '../views/IndexView.vue'
import HomeView from '../views/HomeView.vue'
import TeacherView from '../views/sonview/TeacherView.vue'
import CourseDescription from '../views/sonview/CourseDescription.vue'
import StudentWork from '../views/sonview/StudentWork.vue'
import PublicCourse from '../views/sonview/PublicCourse.vue'
import EpibolyJoin from '../views/sonview/EpibolyJoin.vue'
import TeachingEnvironment from '../views/sonview/TeachingEnvironment.vue'
import RelationWe from '../views/sonview/RelationWe.vue'

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'index',
    component: IndexView
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children: [
      { path: '/home/teachr', name: 'teachr', component: TeacherView },
      { path: '/home/course', name: 'course', component: CourseDescription },
      { path: '/home/student', name: 'student', component: StudentWork },
      { path: '/home/public', name: 'public', component: PublicCourse },
      { path: '/home/join', name: 'join', component: EpibolyJoin },
      { path: '/home/environment', name: 'environment', component: TeachingEnvironment },
      { path: '/home/relation', name: 'relation', component: RelationWe }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
